home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / cenvid9.zip / SCRANDOM.BAT < prev    next >
DOS Batch File  |  1994-03-04  |  801b  |  29 lines

  1. @echo OFF
  2. REM *******************************************************************
  3. REM *** SCRANDOM.BAT - Demonstrate SCREEN.LIB by putting characters ***
  4. REM *** ver.1          randomly all over the screen                 ***
  5. REM *******************************************************************
  6. CEnvi %0.bat
  7. GOTO CENVI_EXIT
  8.  
  9. #include "Screen.lib"
  10.  
  11. // Get Screen Height and Width
  12. ScrHeight = ScreenSize().row;
  13. ScrWidth = ScreenSize().col;
  14.  
  15. // Initialize a random random number generator
  16. srand();
  17.  
  18. // Until key is hit, write random square, random color, random location
  19. while ( !kbhit() ) {
  20.    ScrWrite( '█',rand() % ScrHeight,rand() % ScrWidth,rand() % 0x10,BLACK );
  21. }
  22.  
  23. // flush the keyboard
  24. while( kbhit() ) getch();
  25.  
  26. ScreenCursor(ScrWidth-1,ScrHeight-1);
  27.  
  28. :CENVI_EXIT
  29.